import VueRouter from 'vue-router'

// 导入对应的路由组件
import home from './components/tabbar/HomeContainer.vue'
import member from './components/tabbar/MemberContainer.vue'
import shopcar from './components/tabbar/ShopcarContainer.vue'
import search from './components/tabbar/SearchContainer.vue'
// 新闻列表
import newslist from './components/news/NewsList.vue'
// 新闻列表详情
import newsinfo from './components/news/NewsInfo.vue'
// 图片列表
import photoslist from './components/photos/photolist.vue'
// 图片列表详情
import PhotoInfo from './components/photos/PhotosInfo.vue'
// 商品列表
import GoodsList from './components/goods/GoodsList.vue'
// 商品列表详情
import GoodsInfo from './components/goods/GoodsInfo.vue'
// 图文介绍页面
import GoodsDesc from './components/goods/GoodsDesc.vue'
// 商品评论页面
import GoodsComment from './components/goods/GoodsComment.vue'
// 3.创建路由对象
var router = new VueRouter({
  routes: [
    { path: "/", redirect: "/home" },
    { path: "/home", component: home },
    { path: "/member", component: member },
    { path: "/shopcar", component: shopcar },
    { path: "/search", component: search },
    { path: "/home/newslist", component: newslist },
    { path: "/home/newsinfo/:id", component: newsinfo },
    { path: "/home/photoslist", component: photoslist },
    { path: "/home/photoinfo/:id", component: PhotoInfo },
    { path: "/home/goodslist", component: GoodsList },
    { path: "/home/goodsinfo/:id", component: GoodsInfo, name: "goodsinfo" },
    { path: "/home/goodsdesc/:id", component: GoodsDesc, name: "goodsdesc" },
    { path: "/home/goodscomment/:id" , component: GoodsComment, name:"goodscomment"},
  ],
  linkActiveClass: "mui-active",
});

export default router